<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <title>Document</title>
  <style>
    
  </style>
</head>
<body>
  
</body>
<script>

  for(var i=0;i<10;i++){
    // console.log( random( 2, 7 ) );
    console.log( random( 7, 2 ) );
  }

  // 范围随机数
  function random(min, max){
    return Math.round( Math.random() * (max - min) + min );
  }

</script>
</html>